export const FILE_TYPE = {
  EXCEL: 1,
  WORD: 2,
  PDF: 3,
  PPT: 4,
  IMG: 5,
  RAR: 6,
  NO_LIMIT: 7
}
export const TIME_TYPE = {
  SECOND: 1,
  MIN: 2,
  HOURS: 3,
  DAY: 4,
  MONTH: 5,
  YEAR: 6
}
export const fileArrList = {
  [FILE_TYPE.EXCEL]: {
    label: 'excel',
    value: FILE_TYPE.EXCEL
  },
  [FILE_TYPE.WORD]: {
    label: 'word',
    value: FILE_TYPE.WORD
  },
  [FILE_TYPE.PDF]: {
    label: 'pdf',
    value: FILE_TYPE.PDF
  },
  [FILE_TYPE.PPT]: {
    label: 'ppt',
    value: FILE_TYPE.PPT
  },
  [FILE_TYPE.IMG]: {
    label: '图片',
    value: FILE_TYPE.IMG
  },
  [FILE_TYPE.RAR]: {
    label: '压缩包',
    value: FILE_TYPE.RAR
  },
  [FILE_TYPE.NO_LIMIT]: {
    label: '不限制',
    value: FILE_TYPE.NO_LIMIT
  }
}
export const FILE_TYPE_CONTENT = {
  [FILE_TYPE.EXCEL]: ['xlsx', 'xls', 'csv', 'XLSX', 'XLS', 'CSV'],
  [FILE_TYPE.WORD]: ['doc', 'docx', 'DOC', 'DOCS'],
  [FILE_TYPE.PDF]: ['pdf', 'PDF'],
  [FILE_TYPE.PPT]: ['PPTX', 'PPT', 'pptx', 'ppt'],
  [FILE_TYPE.IMG]: ['jpg', 'png', 'jpeg', 'glf', 'JPG', 'PNG', 'JPEG', 'GLF'],
  [FILE_TYPE.RAR]: ['ZIP', 'RAR', 'TAR', 'zip', 'rar', 'tar']
}

export const dateArrList = {
  [TIME_TYPE.SECOND]: {
    label: '年-月-日 时:分:秒',
    value: TIME_TYPE.SECOND
  },
  [TIME_TYPE.MIN]: {
    label: '年-月-日 时:分',
    value: TIME_TYPE.MIN
  },
  [TIME_TYPE.HOURS]: {
    label: '年-月-日 时',
    value: TIME_TYPE.HOURS
  },
  [TIME_TYPE.DAY]: {
    label: '年-月-日',
    value: TIME_TYPE.DAY
  },
  [TIME_TYPE.MONTH]: {
    label: '年-月',
    value: TIME_TYPE.MONTH
  },
  [TIME_TYPE.YEAR]: {
    label: '年',
    value: TIME_TYPE.YEAR
  }
}
export const DATEFORMAT = {
  [TIME_TYPE.SECOND]: 'yyyy-MM-dd HH:mm:ss',
  [TIME_TYPE.MIN]: 'yyyy-MM-dd HH:mm',
  [TIME_TYPE.HOURS]: 'yyyy-MM-dd HH',
  [TIME_TYPE.DAY]: 'yyyy-MM-dd',
  [TIME_TYPE.MONTH]: 'yyyy-MM',
  [TIME_TYPE.YEAR]: 'yyyy'
}
// 转换不同组件类型
export const formatDateComp = (type) => {
  switch (type) {
    case TIME_TYPE.SECOND:
    case TIME_TYPE.MIN:
    case TIME_TYPE.HOURS:
      return 'datetime'
    case TIME_TYPE.DAY:
      return 'date'
    case TIME_TYPE.MONTH:
      return 'month'
    case TIME_TYPE.YEAR:
      return 'year'
  }
}

export const FILE_OPTIONS = Object.values(fileArrList)
export const TIME_OPTIONS = Object.values(dateArrList)
